package design_patterns

import "sync"

//Singleton 是单例模式类
type singleton struct{}

var s *singleton
var once sync.Once

//GetInstance 用于获取单例模式对象
func GetInstance() *singleton {
	once.Do(func() {
		s = &singleton{}
	})

	return s
}
